Filename | (eval 1111)[/usr/share/perl5/CGI.pm:932] |
Statements | Executed 6 statements in 17µs |
Eval Invoked At | /usr/share/perl5/CGI.pm line 932 |
Sibling evals | 1, 2, 3, 4 |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 24µs | 30µs | unescapeHTML | CGI::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # spent 30µs (24+6) within CGI::unescapeHTML which was called 2 times, avg 15µs/call:
# 2 times (24µs+6µs) by CGI::header at line 51 of (eval 1110)[CGI.pm:932], avg 15µs/call | ||||
2 | # hack to work around earlier hacks | ||||
3 | 1 | 800ns | push @_,$_[0] if @_==1 && $_[0] eq 'CGI'; | ||
4 | 1 | 5µs | 3 | 6µs | my ($self,$string) = CGI::self_or_default(@_); # spent 6µs making 3 calls to CGI::self_or_default, avg 2µs/call |
5 | 1 | 400ns | return undef unless defined($string); | ||
6 | 1 | 4µs | 3 | 2µs | my $latin = defined $self->{'.charset'} ? $self->{'.charset'} =~ /^(ISO-8859-1|WINDOWS-1252)$/i # spent 2µs making 3 calls to CGI::CORE:match, avg 567ns/call |
7 | : 1; | ||||
8 | # thanks to Randal Schwartz for the correct solution to this one | ||||
9 | 1 | 3µs | 3 | 3µs | $string=~ s[&([^\s&]*?);]{ # spent 3µs making 3 calls to CGI::CORE:subst, avg 1µs/call |
10 | local $_ = $1; | ||||
11 | /^amp$/i ? "&" : | ||||
12 | /^quot$/i ? '"' : | ||||
13 | /^gt$/i ? ">" : | ||||
14 | /^lt$/i ? "<" : | ||||
15 | /^#(\d+)$/ && $latin ? chr($1) : | ||||
16 | /^#x([0-9a-f]+)$/i && $latin ? chr(hex($1)) : | ||||
17 | "&$_;" | ||||
18 | }gex; | ||||
19 | 1 | 4µs | return $string; | ||
20 | } | ||||
21 | |||||
22 | ; |